<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>SUPERFACT:  Fichier source de /home/diallo/Jeu_wordox/projet-wordox/src/Jeu.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SUPERFACT</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_jeu_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Jeu.c</div>  </div>
</div>
<div class="contents">
<a href="_jeu_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="_jeu_8h.html">Jeu.h</a>&quot;</span>
<a name="l00002"></a>00002 
<a name="l00003"></a><a class="code" href="_jeu_8c.html#a9bb5bf3afeb745b8eeb20632670ace0b">00003</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#a9bb5bf3afeb745b8eeb20632670ace0b">purger</a>(<span class="keywordtype">void</span>)
<a name="l00004"></a>00004 {
<a name="l00005"></a>00005     <span class="keywordtype">int</span> c;
<a name="l00006"></a>00006 
<a name="l00007"></a>00007     <span class="keywordflow">while</span> ((c = getchar()) != <span class="charliteral">&#39;\n&#39;</span> &amp;&amp; c != EOF)
<a name="l00008"></a>00008     {}
<a name="l00009"></a>00009 }
<a name="l00010"></a>00010 
<a name="l00011"></a><a class="code" href="_jeu_8h.html#adea2de1f9bb9c58341d64db6e20261cc">00011</a> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#a673f2b86610afe4db27976e66baf9723" title="Permet d&#39;initialiser le jeu.">jeuInit</a>(<a class="code" href="struct_jeu.html">Jeu</a>* pJeu)
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013     <span class="keywordtype">int</span> i;
<a name="l00014"></a>00014     printf(<span class="stringliteral">&quot;Entrez le nombre de joueur: &quot;</span>);
<a name="l00015"></a>00015     scanf(<span class="stringliteral">&quot;%d&quot;</span>,&amp;(pJeu-&gt;nbJoueurs));
<a name="l00016"></a>00016     pJeu-&gt;tabJoueurs=(<a class="code" href="struct_joueur.html">Joueur</a> **) malloc(pJeu-&gt;nbJoueurs*<span class="keyword">sizeof</span>(<a class="code" href="struct_joueur.html">Joueur</a>));
<a name="l00017"></a>00017     <span class="keywordflow">for</span>(i=0;i&lt;pJeu-&gt;nbJoueurs;i++)
<a name="l00018"></a>00018     {
<a name="l00019"></a>00019 
<a name="l00020"></a>00020         pJeu-&gt;tabJoueurs[i]=malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct_joueur.html">Joueur</a>));
<a name="l00021"></a>00021         assert(pJeu-&gt;tabJoueurs[i] !=  NULL);
<a name="l00022"></a>00022         <a class="code" href="_joueur_8c.html#ad383925f095fd4871f898f5a2a939dba" title="procédure permettant d&#39;initilaiser une structure joueur">jInitaliser</a>(pJeu-&gt;tabJoueurs[i],i+1);
<a name="l00023"></a>00023         <a class="code" href="_jeu_8c.html#a9bb5bf3afeb745b8eeb20632670ace0b">purger</a>();
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026     }
<a name="l00027"></a>00027     pJeu-&gt;pChev=(<a class="code" href="struct_chevalet.html" title="structure contenant l&#39;ensemble des lettres jouables">Chevalet</a> *) malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct_chevalet.html" title="structure contenant l&#39;ensemble des lettres jouables">Chevalet</a>));
<a name="l00028"></a>00028     <a class="code" href="_chevalet_8c.html#af885c85d48e0afd59769aa0d454183a3" title="procédure permettant d&#39;initiliaser notre chevalet à vide">chevInitialiser</a>(pJeu-&gt;pChev);
<a name="l00029"></a>00029     pJeu-&gt;pTer=(<a class="code" href="struct_terrain.html">Terrain</a> *) malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct_terrain.html">Terrain</a>));
<a name="l00030"></a>00030     <a class="code" href="_terrain_8c.html#af2f7cd75f0590173e5744c710eadebae">terInitialiser</a>(pJeu-&gt;pTer);
<a name="l00031"></a>00031 }
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="_jeu_8h.html#a94a50003b9187499421e07836755d1c1">00033</a> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#ab0aadf2447b504d5735dcc852dbd13ef" title="Libere espace occupé par le jeu.">jeuLib</a>(<a class="code" href="struct_jeu.html">Jeu</a> * pJeu)
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035     <a class="code" href="_jeu_8c.html#a2e3109cf48e464339dda5dda2bf52898" title="permet de liberer le tableau des joueurs">jeuLibTabJoueurs</a>(pJeu);
<a name="l00036"></a>00036     pJeu-&gt;nbJoueurs=0;
<a name="l00037"></a>00037     <a class="code" href="_terrain_8c.html#ab7b2d324f1c403a073fc2c26c9cd7817">terLiberer</a>(pJeu-&gt;pTer);
<a name="l00038"></a>00038     <a class="code" href="_chevalet_8c.html#a51506d7f3c4f23ea2dc1041ef783e29a" title="procédure permettant de liberer notre chevalet à vide">chevLiberer</a>(pJeu-&gt;pChev);
<a name="l00039"></a>00039     free(pJeu-&gt;pChev);
<a name="l00040"></a>00040     free(pJeu-&gt;pTer);
<a name="l00041"></a>00041 }
<a name="l00042"></a><a class="code" href="_jeu_8h.html#add6e58a60f8b837028b76b6632c37bee">00042</a> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#a2e3109cf48e464339dda5dda2bf52898" title="permet de liberer le tableau des joueurs">jeuLibTabJoueurs</a>(<a class="code" href="struct_jeu.html">Jeu</a> * pJeu)
<a name="l00043"></a>00043 { <span class="keywordtype">int</span> i;
<a name="l00044"></a>00044     <span class="keywordflow">for</span>(i=0;i&lt;pJeu-&gt;nbJoueurs;i++)
<a name="l00045"></a>00045     {
<a name="l00046"></a>00046         free(pJeu-&gt;tabJoueurs[i]);
<a name="l00047"></a>00047     }
<a name="l00048"></a>00048 }
<a name="l00049"></a><a class="code" href="_jeu_8h.html#ab7e18d2b50d7e3819c3d7daa860e4107">00049</a> <a class="code" href="struct_terrain.html">Terrain</a> * <a class="code" href="_jeu_8c.html#af1596ffd1a072885cad8ef0895975688" title="Fonction permettant de recuperer l&#39;adresse du terrain en mémoire.">jeuGetTerrain</a>(<span class="keyword">const</span> <a class="code" href="struct_jeu.html">Jeu</a> *pJeu)
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051     <span class="keywordflow">return</span> pJeu-&gt;pTer;
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="_jeu_8h.html#a0db511bb25ae46053c80d373cd940210">00054</a> <a class="code" href="struct_chevalet.html" title="structure contenant l&#39;ensemble des lettres jouables">Chevalet</a> * <a class="code" href="_jeu_8c.html#a91e90791c686584280585b6cc7c45f8d" title="Recupere adresse du chevalet en memoire.">jeuGetChev</a>(<span class="keyword">const</span> <a class="code" href="struct_jeu.html">Jeu</a> *pJeu)
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056     <span class="keywordflow">return</span> pJeu-&gt;pChev;
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="_jeu_8h.html#a4c0561935ff8039139a9cf91c6e7b9b8">00059</a> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#abd60abc7a73edeb3beb7688c8fc6de67" title="permet de réinitialiser le terrain après avoir active le vortex">reInitTer</a>(<a class="code" href="struct_jeu.html">Jeu</a> *pJeu)
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 
<a name="l00062"></a>00062     <a class="code" href="_terrain_8c.html#ab7b2d324f1c403a073fc2c26c9cd7817">terLiberer</a>(pJeu-&gt;pTer);
<a name="l00063"></a>00063     <a class="code" href="_terrain_8c.html#af2f7cd75f0590173e5744c710eadebae">terInitialiser</a>(pJeu-&gt;pTer);
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065 
<a name="l00066"></a><a class="code" href="_jeu_8h.html#aa01f686f906fd953af94d39154ccaefd">00066</a> <span class="keywordtype">void</span> <a class="code" href="_jeu_8c.html#a8dea660e7dc2a2d68d346897ddccda23" title="permet de réinitialiser le chevalet après avoir active le vortex">reInitChev</a>(<a class="code" href="struct_jeu.html">Jeu</a> *pJeu)
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068 
<a name="l00069"></a>00069     <a class="code" href="_chevalet_8c.html#a51506d7f3c4f23ea2dc1041ef783e29a" title="procédure permettant de liberer notre chevalet à vide">chevLiberer</a>(pJeu-&gt;pChev);
<a name="l00070"></a>00070     <a class="code" href="_chevalet_8c.html#af885c85d48e0afd59769aa0d454183a3" title="procédure permettant d&#39;initiliaser notre chevalet à vide">chevInitialiser</a>(pJeu-&gt;pChev);
<a name="l00071"></a>00071 }
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="_jeu_8h.html#a43ced55ab860284a155edde30ba64d81">00073</a>  <span class="keywordtype">int</span> <a class="code" href="_jeu_8c.html#afc6bb04e1bb6e9c2ed7eab2fc4335249" title="permet de verifier un mot">verifFormeMot</a>(<span class="keywordtype">int</span> *x, <span class="keywordtype">int</span> *y,<span class="keywordtype">int</span> tailleTab)
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075     <span class="keywordtype">int</span> i,res;
<a name="l00076"></a>00076     <span class="keywordflow">if</span>(tailleTab==1) <span class="keywordflow">return</span> 1;
<a name="l00077"></a>00077     <span class="keywordflow">for</span>(i=1;i&lt;tailleTab;i++)
<a name="l00078"></a>00078     {
<a name="l00079"></a>00079         <span class="keywordflow">if</span>(x[i]==x[i-1]) {res=1;}
<a name="l00080"></a>00080         <span class="keywordflow">else</span> { res=0; i=6;}
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     }
<a name="l00083"></a>00083     <span class="keywordflow">if</span>(res==0)
<a name="l00084"></a>00084     {
<a name="l00085"></a>00085          <span class="keywordflow">for</span>(i=1;i&lt;tailleTab;i++)
<a name="l00086"></a>00086     {
<a name="l00087"></a>00087         <span class="keywordflow">if</span>(y[i]==y[i-1]) {res=2;}
<a name="l00088"></a>00088         <span class="keywordflow">else</span> { res=0; i=6;}
<a name="l00089"></a>00089 
<a name="l00090"></a>00090     }
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="keywordflow">return</span> res;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 
<a name="l00097"></a><a class="code" href="_jeu_8h.html#ab453ee76e8bdfe4bc456ce45e5117c0c">00097</a> <span class="keywordtype">int</span> <a class="code" href="_jeu_8c.html#a19c5bf018447a9573fcac40f2ff8f292" title="permet de verifier la case centrale">verifJoueEtoile</a>(<span class="keywordtype">int</span> *x, <span class="keywordtype">int</span> *y, <span class="keywordtype">int</span> tailleTab)
<a name="l00098"></a>00098 {
<a name="l00099"></a>00099     <span class="keywordtype">int</span> i, res;
<a name="l00100"></a>00100     res=0;
<a name="l00101"></a>00101     <span class="keywordflow">for</span>(i=0;i&lt;tailleTab;i++)
<a name="l00102"></a>00102     {
<a name="l00103"></a>00103         <span class="keywordflow">if</span>(x[i]==5 &amp;&amp; y[i]==5)
<a name="l00104"></a>00104             res=1;
<a name="l00105"></a>00105 
<a name="l00106"></a>00106     }
<a name="l00107"></a>00107     <span class="keywordflow">return</span> res;
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109 
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="_jeu_8h.html#afd208feb3492eaf1f5d06425aa6f5507">00112</a> <span class="keywordtype">int</span> <a class="code" href="_jeu_8c.html#a77cc61106de4e812f68b71e0984b9668" title="permet de verifier si les lettres qui forment un mot sont raccordes">verifMotRaccorde</a>(<a class="code" href="struct_terrain.html">Terrain</a> * pTer,<span class="keywordtype">int</span> *x, <span class="keywordtype">int</span> *y,<span class="keywordtype">int</span> tailleTab)
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114     <span class="keywordtype">int</span> i;
<a name="l00115"></a>00115     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> res;
<a name="l00116"></a>00116 
<a name="l00117"></a>00117     res=0;
<a name="l00118"></a>00118 <span class="keywordflow">for</span>(i=0;i&lt;tailleTab;i++){
<a name="l00119"></a>00119 
<a name="l00120"></a>00120  <span class="keywordflow">if</span> (x[i]==1)
<a name="l00121"></a>00121     {
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (y[i]==1)
<a name="l00123"></a>00123     {
<a name="l00124"></a>00124     <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00125"></a>00125     res=1;
<a name="l00126"></a>00126     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00127"></a>00127     res=1;
<a name="l00128"></a>00128     }
<a name="l00129"></a>00129     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y[i]==9)
<a name="l00130"></a>00130     {
<a name="l00131"></a>00131         <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00132"></a>00132         res=1;
<a name="l00133"></a>00133         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00134"></a>00134         res=1;
<a name="l00135"></a>00135     }
<a name="l00136"></a>00136  }
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x[i]==9)
<a name="l00139"></a>00139     {
<a name="l00140"></a>00140         <span class="keywordflow">if</span> (y[i]==1)
<a name="l00141"></a>00141         {
<a name="l00142"></a>00142             <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00143"></a>00143             res=1;
<a name="l00144"></a>00144             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00145"></a>00145             res=1;
<a name="l00146"></a>00146         }
<a name="l00147"></a>00147         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y[i]==9)
<a name="l00148"></a>00148         {
<a name="l00149"></a>00149             <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00150"></a>00150             res=1;
<a name="l00151"></a>00151             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00152"></a>00152             res=1;
<a name="l00153"></a>00153         }
<a name="l00154"></a>00154     }
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y[i]==1)
<a name="l00157"></a>00157     {
<a name="l00158"></a>00158         <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00159"></a>00159         res=1;
<a name="l00160"></a>00160         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00161"></a>00161         res=1;
<a name="l00162"></a>00162         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00163"></a>00163         res=1;
<a name="l00164"></a>00164     }
<a name="l00165"></a>00165 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y[i]==9)
<a name="l00166"></a>00166     {
<a name="l00167"></a>00167         <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00168"></a>00168         res=1;
<a name="l00169"></a>00169         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00170"></a>00170         res=1;
<a name="l00171"></a>00171         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00172"></a>00172         res=1;
<a name="l00173"></a>00173     }
<a name="l00174"></a>00174 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(x[i]==1)
<a name="l00175"></a>00175     {
<a name="l00176"></a>00176         <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00177"></a>00177         res=1;
<a name="l00178"></a>00178         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00179"></a>00179         res=1;
<a name="l00180"></a>00180         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00181"></a>00181         res=1;
<a name="l00182"></a>00182     }
<a name="l00183"></a>00183 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(x[i]==9)
<a name="l00184"></a>00184     {
<a name="l00185"></a>00185      <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00186"></a>00186         res=1;
<a name="l00187"></a>00187         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00188"></a>00188         res=1;
<a name="l00189"></a>00189         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00190"></a>00190         res=1;
<a name="l00191"></a>00191     }
<a name="l00192"></a>00192 <span class="keywordflow">else</span>
<a name="l00193"></a>00193     {
<a name="l00194"></a>00194         <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]+1,y[i])&lt;97)
<a name="l00195"></a>00195         res=1;
<a name="l00196"></a>00196         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i]-1,y[i])&lt;97)
<a name="l00197"></a>00197         res=1;
<a name="l00198"></a>00198         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]-1)&lt;97)
<a name="l00199"></a>00199         res=1;
<a name="l00200"></a>00200         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)!=<span class="charliteral">&#39;.&#39;</span> &amp;&amp; <a class="code" href="_terrain_8c.html#a43e155974fd55979d4eca34f5025bb43">terGetXY</a>(pTer,x[i],y[i]+1)&lt;97)
<a name="l00201"></a>00201         res=1;
<a name="l00202"></a>00202     }
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 <span class="keywordflow">return</span> res;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 
<a name="l00207"></a><a class="code" href="_jeu_8h.html#ac403365fbc2591c47dade9911516744e">00207</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="_jeu_8c.html#a37062cff82f8badfbd88c0ce9a2cceb3" title="permet de verifier les cases vortex du jeu">caseVortex</a>(<span class="keywordtype">int</span> *x,<span class="keywordtype">int</span> *y,<span class="keywordtype">int</span> taille)
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     <span class="keywordtype">int</span> i;
<a name="l00210"></a>00210     <span class="keywordflow">for</span>(i=0;i&lt;taille;i++)
<a name="l00211"></a>00211     {
<a name="l00212"></a>00212         <span class="keywordflow">if</span>(x[i]==1 || x[i]==9)
<a name="l00213"></a>00213         {
<a name="l00214"></a>00214             <span class="keywordflow">if</span>(y[i]==1 || y[i]==9)
<a name="l00215"></a>00215             <span class="keywordflow">return</span> 1;
<a name="l00216"></a>00216         }
<a name="l00217"></a>00217     }
<a name="l00218"></a>00218     <span class="keywordflow">return</span> 0;
<a name="l00219"></a>00219 }
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_jeu_8c.html">Jeu.c</a>      </li>
      <li class="footer">Généré le Thu Nov 29 2012 17:24:07 pour SUPERFACT par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
    </ul>
  </div>

</body>
</html>
